package com.citywithincity.db.data2db;

import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Date;

import com.citywithincity.db.interfaces.IPsSetter;

public class Date2Integer implements IPsSetter {

	@Override
	public void setValue(PreparedStatement ps, int index, Object value) throws SQLException {
		Date date = (Date)value;
		if(date==null){
			ps.setInt(index, 0);
		}else{
			ps.setInt(index, (int)(date.getTime()/1000));
		}
		
	}

}
